<?php
/**
 * Created by PhpStorm.
 * User: TheLuther
 * Date: 2019/11/10
 * Time: 21:14
 */

namespace app\cms\validate;

use think\Validate;

class Cms extends Validate{
    protected $rule =   [
        'title'  => 'require|max:255',
        'status'   => 'number|between:-1,10',
    ];

    protected $message  =   [
        'title.require' => '标题不能为空',
        'title.max'     => '名称最多不能超过255个字符',
        'status.number'   => '状态必须是数字',
        'status.between'  => '状态值只能介于-1和10之间',
    ];

    protected $scene = [
        'add'  =>  ['title','status'],
    ];
}